// 项目管理数据
var proColumns = [{
  id: 'type',
  title: '项目类型',
  type: 'string',
  width: 74,
  columnClass: 'text-center',
}, {
    id: 'proName',
    title: '项目名称',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
  },{
    id: 'role',
    title: '我的角色',
    type: 'string',
    width: 74,
    columnClass: 'text-center',
  }, {
    id: 'level',
    title: '优先级',
    type: 'string',
    width: 60,
    columnClass: 'text-center',
  }, {
    id: 'pmp',
    title: '项目经理',
    type: 'string',
    width: 74,
    columnClass: 'text-center',
  }, {
    id: 'phase',
    title: '当前阶段',
    width: 74,
    type: 'string',
    columnClass: 'text-center',
  },
  {
    id: 'status',
    title: '状态',
    type: 'string',
    width: 60,
    codeTable: status,
    columnClass: 'text-center',
    // resolution: function (value, record, column, grid, dataNo, columnNo) {
    //   var content = '';
    //   if (value == 1) {
    //     content += '<span style="background:#5bc0de;padding:2px 10px;color:white;">运行中</span>';
    //   }
    //   if (value == 2) {
    //     content += '<span style="background:#d9534f;padding:2px 10px;color:white;">已关闭</span>';
    //   }
    //   if (value == 3) {
    //     content += '<span style="background:#5cb85c;padding:2px 10px;color:white;">已完结</span>';
    //   }
    //   if (value == 4) {
    //     content += '<span style="background:#f8d347;padding:2px 10px;color:white;">已暂停</span>';
    //   }
    //   return content;
    // }
  },
  {
    id: 'progress',
    title: '项目当前进展',
    type: 'string',
    columnClass: 'text-left',
  }, {
    id: 'operation',
    title: '操作',
    width: 300,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="proBuild(' + record.id + ');"><i class="fa fa-edit"></i>  立项</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-primary" onclick="tender(' + record.id + ');"><i class="icon-briefcase"></i>  投标</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-success" onclick="price(' + record.id + ');"><i class="icon-file-text-alt"></i>  报价</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-warning" onclick="progress(' + record.id + ');"><i class="icon-retweet"></i>  进展</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-default" onclick="proinfo(' + record.id + ');"><i class="icon-gear (alias)"></i>  管理</button>';
      return content;
    }
  }
];
var proOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目管理',
  datas: [{
    id: 1,
    type: '销售类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '运行中',
    progress: '项目整体进展测试数据'
  }, {
    id: 2,
    type: '部门类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '已关闭',
    progress: '项目整体进展测试数据'
  }, {
    id: 3,
    type: '研发类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '已完结',
    progress: '项目整体进展测试数据'
  }, {
    id: 4,
    type: '测试类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '已暂停',
    progress: '项目整体进展测试数据'
  }, {
    id: 5,
    type: '事务类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '已暂停',
    progress: '项目整体进展测试数据'
  }, {
    id: 6,
    type: '战略类型',
    proName: '项目名称',
    role: '产品经理',
    level: '高',
    pmp: '张三',
    phase: '线索阶段',
    status: '已暂停',
    progress: '项目整体进展测试数据'
  }, ],
  columns: proColumns,
  gridContainer: 'proContainer',
  toolbarContainer: 'proToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proGrid = $.fn.dlshouwen.grid.init(proOption);
$(function () {
  proGrid.load();
});
// 立项操作
function proBuild(id) {
  if(id==1){
    location.href = './edit/edit-project-1.html';
  }
  if(id==2){
    location.href = './edit/edit-project-2.html';
  }
  if(id==3){
    location.href = './edit/edit-project-3.html';
  }
  if(id==4){
    location.href = './edit/edit-project-4.html';
  }
  if(id==5){
    location.href = './edit/edit-project-5.html';
  }
  if(id==6){
    location.href = './edit/edit-project-6.html';
  }
}
// 投标操作
function tender(id) {
  location.href = './edit/edit-tender.html';
}
// 商务报价操作
function price(id) {
  location.href = './edit/edit-price.html';
}
// 项目进展操作
function progress(id) {
  location.href = './../proinfo/okr.html';
}
// 项目管理操作
function proinfo(id) {
  location.href = '../../proinfo.html';
}
//客户管理数据
var customerColumns = [{
    id: 'customerName',
    title: '客户名称',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'customerType',
    title: '客户类型',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'contact',
    title: '联系方式',
    type: 'string',
    width: 110,
    columnClass: 'text-center'
  },
  {
    id: 'personnel',
    title: '负责人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'industry',
    title: '行业',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'address',
    title: '地址',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 320,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="selsu(' + record.id + ');"><i class="icon-edit"></i>  更新客户信息</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-primary" onclick="selist(' + record.id + ');"><i class="icon-eye-open"></i>  查看联系人</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-info" onclick="selsut(' + record.id + ');"><i class="icon-plus"></i>  添加联系人</button>';
      return content;
    }
  }
];
var customerOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '客户管理',
  datas: [{
      id: 1,
      customerName: '张三',
      customerType: '销售',
      industry: '城市移动网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 2,
      customerName: '张三',
      customerType: '研发',
      industry: '城市联通网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 3,
      customerName: '张三',
      customerType: '渠道商',
      industry: '城市电信网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 4,
      customerName: '张三',
      customerType: '产品经理',
      industry: '智慧城市网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 5,
      customerName: '张三',
      customerType: 'HR',
      industry: '公共服务网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 6,
      customerName: '张三',
      customerType: '行政',
      industry: '教育机构',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 7,
      customerName: '张三',
      customerType: '人事',
      industry: '城市移动网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 8,
      customerName: '张三',
      customerType: '分销商',
      industry: '城市移动网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 9,
      customerName: '张三',
      customerType: '区域总监',
      industry: '城市移动网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    },
    {
      id: 10,
      customerName: '张三',
      customerType: '主管',
      industry: '城市移动网络',
      area: '华北',
      address: '北京市朝阳区XX小区2220室',
      contact: '12345678901',
      personnel: '李四'
    }
  ],
  columns: customerColumns,
  gridContainer: 'customerContainer',
  toolbarContainer: 'customerToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var customerGrid = $.fn.dlshouwen.grid.init(customerOption);
$(function () {
  customerGrid.load();
});
// 编辑客户
function selsu(id){
  window.location.href = "./edit/edit-customer-1.html" + '?id=' + id;
};
// 新增联系人
function selsut(id){
  window.location.href = "./edit/edit-customer-2.html" + '?id=' + id;
};
// 查看联系人
function selist(id){
  window.location.href = "./edit/edit-customer-3.html" + '?id=' + id;
};
//联系人管理数据
var telColumns = [{
    id: 'telName',
    title: '联系人名称',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'tell',
    title: '联系方式',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'email',
    title: '邮件地址',
    type: 'string',
    width: 300,
    columnClass: 'text-center'
  },
  {
    id: 'annotation',
    title: '注释',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.telName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
      content += '  ';
      content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
      return content;
    }
  }
];
var telOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '联系人管理',
  datas: [{
    id: 1,
    telName: '张三',
    tell: '12345678901',
    industry: '城市移动网络',
    email: 'zhangsan@certusnet.com',
    annotation: '测试数据'
  }, ],
  columns: telColumns,
  gridContainer: 'telContainer',
  toolbarContainer: 'telToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var telGrid = $.fn.dlshouwen.grid.init(telOption);
$(function () {
  telGrid.load();
});
// 新增联系人
function showtel() {
  $("#telbox").show();
}
// 需求管理
var demandColumns = [{
    id: 'doName',
    title: '当前处理人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'time',
    title: '提交时间',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'from',
    title: '来源',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'subName',
    title: '提交人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'proLine',
    title: '产品线',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'priority',
    title: '优先级',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'version',
    title: '基本版本号',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'describe',
    title: '需求描述',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 80,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="editdemand(' + record.id + ',' + record.demandType + ')"><i class="fa fa-edit"></i>  办理</button>';
      return content;
    }
  }
];
var demandOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '需求管理',
  datas: [{
    id: 1,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批的操作',
    demandType: 1
  }, {
    id: 2,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批结果：被退回',
    demandType: 2
  }, {
    id: 3,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交需求申请，需求管理员审批通过后的评审小组操作',
    demandType: 3
  },
   {
    id: 4,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员评审通过，评审小组审批结论：不通过',
    demandType: 4
  }, 
  // {
  //   id: 5,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员评审通过，评审小组审批通过，售前产品经理审批',
  //   demandType: 5
  // },
  //  {
  //   id: 6,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员评审通过，评审小组审批通过，售前产品经理审批结果：被退回',
  //   demandType: 6
  // }, 
  // {
  //   id: 6,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员、评审小组、售前产品经理审批通过，研发领导审批',
  //   demandType: 6
  // },
  // {
  //   id: 8,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '需求管理员、评审小组、售前产品经理审批通过，研发领导审批结果：被退回',
  //   demandType: 8
  // },
  {
    id: 7,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付经理验证！',
    demandType: 7
  },{
    id: 8,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付验证未通过，再次验证',
    demandType: 8
  },{
    id: 9,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '需求管理员、评审小组、售前产品经理、研发领导审批通过，交付验证通过',
    demandType: 9
  }, ],
  columns: demandColumns,
  gridContainer: 'demandContainer',
  toolbarContainer: 'demandToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var demandGrid = $.fn.dlshouwen.grid.init(demandOption);
$(function () {
  demandGrid.load();
});
// 处理需求
function editdemand(id, demandType) {
  if (demandType == 1) {
    window.location.href = "../../project/edit/edit-demand-1.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 2) {
    window.location.href = "../../project/edit/edit-demand-2.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 3) {
    window.location.href = "../../project/edit/edit-demand-3.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 4) {
    window.location.href = "../../project/edit/edit-demand-4.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 5) {
    window.location.href = "../../project/edit/edit-demand-5.html" + '?id=' + id + '&demandType=' + demandType;
  }
  // if (demandType == 6) {
  //   window.location.href = "../../project/edit/edit-demand-6.html" + '?id=' + id + '&demandType=' + demandType;
  // }
  if (demandType == 6) {
    window.location.href = "../../project/edit/edit-demand-6.html" + '?id=' + id + '&demandType=' + demandType;
  }
  // if (demandType == 8) {
  //   window.location.href = "../../project/edit/edit-demand-8.html" + '?id=' + id + '&demandType=' + demandType;
  // }
  if (demandType == 7) {
    window.location.href = "../../project/edit/edit-demand-7.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 8) {
    window.location.href = "../../project/edit/edit-demand-8.html" + '?id=' + id + '&demandType=' + demandType;
  }
  if (demandType == 9) {
    window.location.href = "../../project/edit/edit-demand-9.html" + '?id=' + id + '&demandType=' + demandType;
  }
}
// 问题管理
var problemColumns = [{
    id: 'doName',
    title: '当前处理人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'time',
    title: '提交时间',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'from',
    title: '来源',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'subName',
    title: '提交人',
    type: 'string',
    width: 100,
    columnClass: 'text-center'
  },
  {
    id: 'proLine',
    title: '产品线',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'priority',
    title: '优先级',
    type: 'string',
    width: 80,
    columnClass: 'text-center'
  },
  {
    id: 'version',
    title: '基本版本号',
    type: 'string',
    columnClass: 'text-center'
  },
  {
    id: 'describe',
    title: '问题描述',
    type: 'string',
    columnClass: 'text-left'
  },
  {
    id: 'operation',
    title: '操作',
    type: 'string',
    width: 80,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
      var content = '';
      content += '<button class="btn btn-xs btn-success" onclick="editproblem(' + record.id + ',' + record.problemType + ')"><i class="fa fa-edit"></i>  办理</button>';
      return content;
    }
  }
];
var problemOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '问题管理',
  datas: [{
    id: 1,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批的操作',
    problemType: 1
  }, {
    id: 2,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批结果：被退回',
    problemType: 2
  }, {
    id: 3,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '提交问题申请，问题管理员审批通过后的评审小组操作',
    problemType: 3
  }, 
  {
    id: 4,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员评审通过，评审小组审批结论：不通过',
    problemType: 4
  },
  //  {
  //   id: 5,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '问题管理员评审通过，评审小组审批通过，售前产品经理审批',
  //   problemType: 5
  // },
  // {
  //   id: 6,
  //   doName: '姓名张三',
  //   time: '9999-99-99',
  //   from: '研发部门',
  //   subName: '姓名李四',
  //   proLine: 'NFV',
  //   priority: '高',
  //   version: 'V1.0.1',
  //   describe: '问题管理员、评审小组、售前产品经理审批通过，研发领导审批',
  //   problemType: 6
  // },
  {
    id: 7,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付经理验证！',
    problemType: 7
  },{
    id: 8,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付验证未通过，再次验证',
    problemType: 8
  },{
    id: 9,
    doName: '姓名张三',
    time: '9999-99-99',
    from: '研发部门',
    subName: '姓名李四',
    proLine: 'NFV',
    priority: '高',
    version: 'V1.0.1',
    describe: '问题管理员、评审小组、售前产品经理、研发领导审批通过，交付验证通过',
    problemType: 9
  }, ],
  columns: problemColumns,
  gridContainer: 'problemContainer',
  toolbarContainer: 'problemToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var problemGrid = $.fn.dlshouwen.grid.init(problemOption);
$(function () {
  problemGrid.load();
});
// 处理问题
function editproblem(id, problemType) {
  if (problemType == 1) {
    window.location.href = "../../project/edit/edit-problem-1.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 2) {
    window.location.href = "../../project/edit/edit-problem-2.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 3) {
    window.location.href = "../../project/edit/edit-problem-3.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 4) {
    window.location.href = "../../project/edit/edit-problem-4.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 5) {
    window.location.href = "../../project/edit/edit-problem-5.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 6) {
    window.location.href = "../../project/edit/edit-problem-6.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 7) {
    window.location.href = "../../project/edit/edit-problem-7.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 8) {
    window.location.href = "../../project/edit/edit-problem-8.html" + '?id=' + id + '&problemType=' + problemType;
  }
  if (problemType == 9) {
    window.location.href = "../../project/edit/edit-problem-9.html" + '?id=' + id + '&problemType=' + problemType;
  }
}
// 需求信息处理记录
var editDemandColumns = [{
  id: 'doTime',
  title: '操作时间',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'dohistory',
  title: '操作记录',
  type: 'string',
  columnClass: 'text-left',
}, ];
var editDemandOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '需求信息处理记录',
  datas: [{
    doTime: '9999-99-99 24:00',
    dohistory: '张三提交需求申请',
  }, ],
  columns: editDemandColumns,
  gridContainer: 'editDemandContainer',
  toolbarContainer: 'editDemandToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var editDemandGrid = $.fn.dlshouwen.grid.init(editDemandOption);
$(function () {
  editDemandGrid.load();
});
//时间控件
$('#datetime').datepicker({
  format: 'yyyy-mm-dd'
});
$('#datetime-1').datepicker({
  format: 'yyyy-mm-dd'
});
$('#datetime-2').datepicker({
  format: 'yyyy-mm-dd'
});
// 问题信息处理记录
var editProblemColumns = [{
  id: 'doTime',
  title: '操作时间',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'dohistory',
  title: '操作记录',
  type: 'string',
  columnClass: 'text-left',
}, ];
var editProblemOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '问题信息处理记录',
  datas: [{
    doTime: '9999-99-99 24:00',
    dohistory: '张三提交问题申请',
  }, ],
  columns: editProblemColumns,
  gridContainer: 'editProblemContainer',
  toolbarContainer: 'editProblemToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var editProblemGrid = $.fn.dlshouwen.grid.init(editProblemOption);
$(function () {
  editProblemGrid.load();
});
//文件下载权限申请
$(".download-icon").on('click', function () {
  //询问框
  layer.confirm('权限不足，是否申请更高权限？', {
    title: '提示信息',
    btn: ['申请', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
});
//文件上传统一字段
function showfile() {
  $(".hidefile").show();
}

function hidefile() {
  $(".hidefile").hide();
}
// 立项选择展示隐藏效果
$('#remember').change(function () {
  var status = $('#remember').prop("checked");
  if (status) {
    $('.hideprobox').show()
  } else {
    $('.hideprobox').hide()
  }
});
// 立项信息-其他费用
var otherColumns = [{
  id: 'things',
  title: '事由',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'amount',
  title: '预算金额',
  width: 200,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.things + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var otherOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '其他费用',
  datas: [{
    things: 'XXXXXX费用支出测试数据',
    amount: '￥299929.99',
  }, ],
  columns: otherColumns,
  gridContainer: 'otherContainer',
  toolbarContainer: 'otherToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var otherGrid = $.fn.dlshouwen.grid.init(otherOption);
$(function () {
  otherGrid.load();
});

var other1Columns = [{
  id: 'things',
  title: '事由',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'amount',
  title: '预算金额',
  width: 200,
  type: 'string',
  columnClass: 'text-center',
},];
var other1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '其他费用',
  datas: [{
    things: 'XXXXXX费用支出测试数据',
    amount: '￥299929.99',
  }, ],
  columns: other1Columns,
  gridContainer: 'other1Container',
  toolbarContainer: 'other1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var other1Grid = $.fn.dlshouwen.grid.init(other1Option);
$(function () {
  other1Grid.load();
});
// 立项信息-项目指标
var proinColumns = [{
  id: 'indName',
  title: '指标名称',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'indMsg',
  title: '指标描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'indTime',
  title: '完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.indName + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var proinOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目指标',
  datas: [{
    indName: '指标名称测试数据',
    indMsg: '指标描述测试数据',
    indTime: '9999-99-99',
  }, ],
  columns: proinColumns,
  gridContainer: 'proinContainer',
  toolbarContainer: 'proinToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proinGrid = $.fn.dlshouwen.grid.init(proinOption);
$(function () {
  proinGrid.load();
});

var proin1Columns = [{
  id: 'indName',
  title: '指标名称',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'indMsg',
  title: '指标描述',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'indTime',
  title: '完成时间',
  type: 'string',
  width: 100,
  columnClass: 'text-left',
}, ];
var proin1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目指标',
  datas: [{
    indName: '指标名称测试数据',
    indMsg: '指标描述测试数据',
    indTime: '9999-99-99',
  }, ],
  columns: proin1Columns,
  gridContainer: 'proin1Container',
  toolbarContainer: 'proin1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proin1Grid = $.fn.dlshouwen.grid.init(proin1Option);
$(function () {
  proin1Grid.load();
});
//项目指标表单显示隐藏
function hideproin() {
  $(".hideproin").hide();
};

function showproin() {
  $(".hideproin").show();
};
//项目其他费用表单显示隐藏
function hideother() {
  $(".hideother").hide();
};

function showother() {
  $(".hideother").show();
};
// 商务报价条目管理显示隐藏
function showprice() {
  $(".hideprice").show();
}

function hideprice() {
  $(".hideprice").hide();
}
// 商务报价-历史记录
var piclogColumns = [{
  id: 'time',
  title: '提交日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'subName',
  title: '提交人',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'price',
  title: '商务报价总价',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'buy',
  title: '商务信息预测',
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '申请说明',
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'finish',
  title: '审批结果',
  type: 'finish',
  width: 100,
  codeTable: status,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    if (value == 0) {
      content += '<span style="background:#d9534f;padding:2px 10px;color:white;">未通过</span>';
    }
    if (value == 1) {
      content += '<span style="background:#5cb85c;padding:2px 10px;color:white;">已通过</span>';
    }
    return content;
  }
},{
  id: 'operation',
  title: '报价文件',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="down(' + record.id + ');"><i class="icon-cloud-download"></i>  下载</button>';
    return content;
  }
}];
var piclogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '商务报价-历史记录',
  datas: [{
    id: 1,
    time: '2019-01-09',
    subName: '张三',
    price: '￥222.00元',
    buy: '商务信息预测测试数据',
    msg: '申请说明测试数据',
    finish: 0,
  }, ],
  columns: piclogColumns,
  gridContainer: 'piclogContainer',
  toolbarContainer: 'piclogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var piclogGrid = $.fn.dlshouwen.grid.init(piclogOption);
$(function () {
  piclogGrid.load();
});
// 商务报价
var priceColumns = [{
  id: 'type',
  title: '分类',
  width: 160,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'liPrice',
  title: '目录价',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'discount',
  title: '折扣率',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'discount1',
  title: '折后率',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'discount2',
  title: '税率',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'fisPrice',
  title: '税后价',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'test',
  title: '说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'operation',
  title: '操作',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-info" onclick="layer.msg(\'编辑：' + record.type + '信息\');"><i class="fa fa-edit"></i>  编辑</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-danger" onclick="del(' + record.id + ');"><i class="fa fa-trash-o"></i>  删除</button>';
    return content;
  }
}];
var priceOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '商务报价',
  datas: [{
    type: '软件',
    liPrice: '￥222.00元',
    discount: '20%',
    discount1: '30%',
    discount2: '30%',
    fisPrice:'￥1111.00元',
    test: '说明测试数据'
  }, ],
  columns: priceColumns,
  gridContainer: 'priceContainer',
  toolbarContainer: 'priceToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var priceGrid = $.fn.dlshouwen.grid.init(priceOption);
$(function () {
  priceGrid.load();
});
//文件下载权限事件
function down(id) {
  //询问框
  layer.confirm('权限不足，是否申请更高权限？', {
    title: '提示信息',
    btn: ['申请', '取消'] //按钮
  }, function () {
    layer.msg('申请成功', {
      icon: 1
    });
  });
}